package com.tanhua.model.vo;

import com.tanhua.model.db.Options;
import com.tanhua.model.db.Questions;
import com.tanhua.model.db.TestSoul;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TestSoulVo implements Serializable {

    private String id;
    private String name;
    private String cover;
    private String level;
    private Integer star;
    private List<QuestionsVo> questions;
    private Integer isLock;
    private String reportId;


    public static TestSoulVo init(TestSoul testSoul, List<QuestionsVo> questions){
        TestSoulVo vo = new TestSoulVo();
        vo.setId(testSoul.getId().toString());
        vo.setName(testSoul.getName());
        vo.setCover(testSoul.getCover());
        vo.setLevel(testSoul.getLevel());
        vo.setStar(testSoul.getStar());
        vo.setQuestions(questions);
        vo.setIsLock(testSoul.getIsLock());
        vo.setReportId(null);
        return vo;
    }
}
